<?php

/**
 * inscription actions.
 *
 * @package    sf_sandbox
 * @subpackage inscription
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 8507 2008-04-17 17:32:20Z fabien $
 */
class inscriptionActions extends sfActions
{
  public function executeCreate($request)
  {
    $this->form = new CustomersForm();

    $this->setTemplate('edit');
    
  }

  public function executeUpdate($request)
  {
    $this->forward404Unless($request->isMethod('post'));

    $this->form = new CustomersForm();

    $this->form->bind($request->getParameter('customers'));
    
    if ($this->form->isValid())
    {
      if ($request->isMethod('post'))
      {
        $this->form->save();
        $this->redirect('index/index');
      }
    }

    $this->setTemplate('edit');
  }
  public function executeEditZone($request)
  {
    $c = new Criteria();
    $c->addSelectColumn(ZonesPeer::ZONE_ID);
    $c->addSelectColumn(ZonesPeer::ZONE_NAME);
    $c->add(ZonesPeer::ZONE_COUNTRY_ID, $request->getParameter('countries'));
    $rs = ZonesPeer::doSelectRS($c);
    $zone=array();
    while($rs->next())
    {
      $zone[$rs->getInt(1)]=$rs->getString(2);
    }
    
    $this->zone = $zone;
    
    
  }
}
